package org.openbam.core.stmt;

import org.openbam.core.expr.IExpression;
import org.openbam.core.expr.IOperatingWindow;
import org.openbam.core.expr.IReportingInterval;

import java.util.Map;

/**
 * A statement will evaluate all expressions before invoking the reporing interval.
 * If the reporting interval determines that it is time to report, then it will in turn ask
 * the statement to do the reporting.
 * User: indersabharwal
 */
public interface IStatement {

    Map<String, IExpression> getExpressions();

    IOperatingWindow getOperatingWindow();

    IReportingInterval getReportingInterval();

    void addExpression(String name, IExpression expression);

    void removeExpression(String name);

    /**
     * You can ask the statement to report it's current state at any time.
     */
    void report(Map<String, Object> result);

    /**
     * Inform any handlers that are interested in knowing the current state of the
     * statement.
     *
     * @param dueTo the interval due to which this method is being invoked.
     */
    void report(IReportingInterval dueTo);

}
